
<div class="panel panel-default" style="">

    <ul class="nav nav-tabs" style="margin-top: 5px; padding-left: 10px;">
  
        <li class="{if (empty($rd) || $rd=='index')}active{/if}">
        <a href="{php echo $this->createWebUrl('village', array('op' => $operation))}"> 
            {$submenus[$operation]['name']}列表</a></li>
        <li  class="{if ( $rd=='add')}active{/if}">
        <a href="{php echo $this->createWebUrl('village', array('op' => $operation,'rd'=>'add'))}">新增 </a></li>
     
    </ul>

    <div class="panel-body"> 


            <form action=""  method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">

            
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                        <span style='color:red'></span>所在区域：</label>
                    <div class="col-sm-8 col-xs-8">
                              <div class="input-group form-group">
                            
                         <span style="display:table-cell; "> 
                 {php echo form_element::select($selects['citys'],'data[parent_id]','city_id', 1,'1','city', 'onchange="navcityto(this)"');}
                </span>
                 
                         <span id="areasbd" style="display:table-cell; ">         
                 {php echo  form_element::select($selects['areas'],'data[area]','area',$item['area']);}
                     </span>
                        
                              </div>   
                    </div>
                </div> 
                
                  <script type="text/javascript">
                    
                    /*区域商圈格式数据*/
                   
                        function navcityto(obj) {
                            var id = obj.value;
                            $.ajax({
                                url: "{php echo $this->createWebUrl('send', array('op'=>'cityareas'))}" + "&id=" + id,
                                success: function (ret) {
                                    $("#areasbd").html(ret);
                                    $("#area").change(function () {
                                        init_area_quan(this.value);
                
                                    })
                                }
                            });
                
                        }
                  </script>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                            <span style='color:red'>*</span>名称 </label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="data[name]" id="name" class="form-control"
                           placeholder="必填项 "  value="{$item['name']}" />
                                
                    </div>
                </div>
{if $type==3}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">坐标</label>
                    <div class="col-sm-6 col-xs-12">
                        <?php
                        $map = ['lng'=>'', 'lat'=>''];
                        if($item['point']){
                            $mapinfo = explode(',',$item['point']);
                            $map['lng'] = isset($mapinfo[0])?$mapinfo[0]:'' ;
                            $map['lat'] = isset($mapinfo[1])?$mapinfo[1]:'';
                        }
                         
                        echo tpl_form_field_coordinate('data[point]',  $map );
                        ?>
                    </div>
                   
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">地址</label>
                    <div class="col-sm-6 col-xs-12">
                        <input type="text"class="form-control" name="data[address]" id="address" value="{$item['address']}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">封面图</label>
                    <div class="col-sm-9 col-xs-12">                
                        {php echo tpl_form_field_image('data[thumb]', $item['thumb'], '', array('extras' => array('text' => 'readonly')))}
                    </div>                
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">物业公司</label>
                    <div class="col-sm-6 col-xs-12">
                        <input type="text"class="form-control" name="data[wuye]" id="wuye" value="{$item['wuye']}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">物业电话</label>
                    <div class="col-sm-6 col-xs-12">
                        <input type="text"class="form-control" name="data[telephone]" id="telephone" value="{$item['telephone']}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">物业费</label>
                    <div class="col-sm-6 col-xs-12">
                        <input type="text"class="form-control" name="data[avaprice]" id="avaprice" value="{$item['avaprice']}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">绿化率</label>
                    <div class="col-sm-6 col-xs-12">
                        <input type="text"class="form-control" name="data[lvhua]" id="lvhua" value="{$item['lvhua']}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">容积率</label>
                    <div class="col-sm-6 col-xs-12">
                        <input type="text"class="form-control" name="data[rongji]" id="rongji" value="{$item['rongji']}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">车位数</label>
                    <div class="col-sm-6 col-xs-12">
                        <input type="text"class="form-control" name="data[chewei]" id="chewei" value="{$item['chewei']}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">建造年代</label>
                    <div class="col-sm-6 col-xs-12">
                        <input type="text"class="form-control" name="data[mainhouse]" id="mainhouse" value="{$item['mainhouse']}"/>
                    </div>
                </div>
                
{/if}
                <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                        <span style='color:red'></span>排序 </label>
                <div class="col-sm-3 col-xs-12">
                    <input type="text" name="data[orderid]" id="orderid" class="form-control"
                                    placeholder=" "  value="{$item['orderid']}" />
                            <p>数值越大越排前面</p> 
                </div>
                
                </div>
                   
                <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                        <span style='color:red'>*</span>状态 </label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="radio" name="data[disabled]"  class=" "
                                    {if $item['disabled']==0}checked{/if}  value="0" />启用
                                
                                <input type="radio" name="data[disabled]"  class=" "
                                    {if $item['disabled']==1}checked{/if}   value="1" />禁用
                                
                    </div>
                </div>
                <div class="form-group ">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">操作</label>
                    <div class="col-sm-9 col-xs-12">
                                <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
                                <input type="hidden" name="id" value="{$item['id']}" />
                                <input type="hidden" name="token" value="{$_W['token']}" />
                                <input type="hidden" name="type" value="{$type}" />
                        </div>
                </div>
            </form>
 </div>
 </div>